home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
CIncludes
/
Kernel.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-05-01
|
29KB
|
866 lines
/*
File: Kernel.h
Contains: Kernel Interfaces
Version: Technology: System 8
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
*/
#ifndef __KERNEL__
#define __KERNEL__
#ifndef __ERRORS__
#include <Errors.h>
#endif
#ifndef __MACHINEEXCEPTIONS__
#include <MachineExceptions.h>
#endif
#ifndef __TIMING__
#include <Timing.h>
#endif
#ifndef __TYPES__
#include <Types.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT_SUPPORTED
#pragma import on
#endif
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=power
/* the following contents can only be used by compilers that support PowerPC struct alignment */
#if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
/* Kernel basics*/
typedef struct OpaqueAddressSpaceID* AddressSpaceID;
typedef struct OpaqueIOPreparationID* IOPreparationID;
typedef struct OpaqueSoftwareInterruptID* SoftwareInterruptID;
typedef struct OpaqueTaskID* TaskID;
typedef struct OpaqueTimerID* TimerID;
/* Tasking*/
typedef UInt32 ExecutionLevel;
enum {
kTaskLevel = 0,
kSoftwareInterruptLevel = 1,
kAcceptFunctionLevel = 2,
kKernelLevel = 3,
kSIHAcceptFunctionLevel = 4,
kSecondaryInterruptLevel = 5,
kHardwareInterruptLevel = 6
};
typedef void (*SoftwareInterruptHandler)(void *p1, void *p2);
typedef OSStatus (*SecondaryInterruptHandler2)(void *p1, void *p2);
/* Memory System basics*/
struct LogicalAddressRange {
LogicalAddress address;
ByteCount count;
};
typedef struct LogicalAddressRange LogicalAddressRange;
typedef LogicalAddressRange *LogicalAddressRangePtr;
struct PhysicalAddressRange {
PhysicalAddress address;
ByteCount count;
};
typedef struct PhysicalAddressRange PhysicalAddressRange;
typedef PhysicalAddressRange *PhysicalAddressRangePtr;
/* For PrepareMemoryForIO and CheckpointIO*/
typedef OptionBits IOPreparationOptions;
enum {
kIOMultipleRanges = 0x00000001,
kIOLogicalRanges = 0x00000002,
kIOMinimalLogicalMapping = 0x00000004,
kIOShareMappingTables = 0x00000008,
kIOIsInput = 0x00000010,
kIOIsOutput = 0x00000020,
kIOCoherentDataPath = 0x00000040,
kIOTransferIsLogical = 0x00000080,
kIOClientIsUserMode = 0x00000080
};
typedef OptionBits IOPreparationState;
enum {
kIOStateDone = 0x00000001
};
enum {
kInvalidPageAddress = (-1)
};
struct AddressRange {
void * base;
ByteCount length;
};
typedef struct AddressRange AddressRange;
/* C's treatment of arrays and array pointers is atypical*/
typedef LogicalAddress *LogicalMappingTablePtr;
typedef PhysicalAddress *PhysicalMappingTablePtr;
typedef AddressRange *AddressRangeTablePtr;
struct MultipleAddressRange {
ItemCount entryCount;
AddressRangeTablePtr rangeTable;
};
typedef struct MultipleAddressRange MultipleAddressRange;
/*
Separate C definition so that union has a name. A future version of the interfacer
tool will allow a name (that gets thrown out in Pascal and Asm).
*/
struct IOPreparationTable {
IOPreparationOptions options;
IOPreparationState state;
IOPreparationID preparationID;
AddressSpaceID addressSpace;
ByteCount granularity;
ByteCount firstPrepared;
ByteCount lengthPrepared;
ItemCount mappingEntryCount;
LogicalMappingTablePtr logicalMapping;
PhysicalMappingTablePtr physicalMapping;
union {
AddressRange range;
MultipleAddressRange multipleRanges;
} rangeInfo;
};
typedef struct IOPreparationTable IOPreparationTable;
typedef OptionBits IOCheckpointOptions;
enum {
kNextIOIsInput = 0x00000001,
kNextIOIsOutput = 0x00000002,
kMoreIOTransfers = 0x00000004
};
/* For SetProcessorCacheMode*/
typedef UInt32 ProcessorCacheMode;
enum {
kProcessorCacheModeDefault = 0,
kProcessorCacheModeInhibited = 1,
kProcessorCacheModeWriteThrough = 2,
kProcessorCacheModeCopyBack = 3
};
/* For GetPageInformation*/
enum {
kPageInformationVersion = 1
};
typedef UInt32 PageStateInformation;
enum {
kPageIsProtected = 0x00000001,
kPageIsProtectedPrivileged = 0x00000002,
kPageIsModified = 0x00000004,
kPageIsReferenced = 0x00000008,
kPageIsLockedResident = 0x00000010,
kPageIsInMemory = 0x00000020,
kPageIsShared = 0x00000040,
kPageIsWriteThroughCached = 0x00000080,
kPageIsCopyBackCached = 0x00000100,
kPageIsLocked = kPageIsLockedResident, /* Deprecated*/
kPageIsResident = kPageIsInMemory /* Deprecated*/
};
struct PageInformation {
AreaID area;
ItemCount count;
PageStateInformation information[1];
};
typedef struct PageInformation PageInformation;
typedef PageInformation *PageInformationPtr;
#endif
#if FOR_SYSTEM8_PREEMPTIVE
typedef struct OpaqueAreaReservationID* AreaReservationID;
typedef struct OpaqueBackingObjectID* BackingObjectID;
typedef struct OpaqueEventGroupID* EventGroupID;
typedef struct OpaqueMessageID* MessageID;
typedef struct OpaqueObjectID* ObjectID;
typedef struct OpaquePortID* PortID;
typedef struct OpaqueReceiveID* ReceiveID;
typedef struct OpaqueKernelProcessID* KernelProcessID;
typedef struct OpaqueKernelQueueID* KernelQueueID;
/* System Information */
enum {
kSystemInformationVersion = 1
};
struct SystemInformation {
ItemCount numPhysicalRAMPages;
ItemCount numFreeRAMPages;
ItemCount numEligibleRAMPages;
ItemCount numResidentRAMPages;
ItemCount numInMemoryGlobalPages;
ItemCount numLogicalPages;
ByteCount pageSize;
ByteCount dataCacheBlockSize;
UInt32 processorVersionNumber;
ItemCount numCPUs;
KernelProcessID systemKernelProcessID;
AddressSpaceID globalAddressSpaceID;
ByteCount dataCacheSize;
ByteCount instructionCacheSize;
Boolean cachesAreUnified;
SInt8 filler[3];
};
typedef struct SystemInformation SystemInformation;
typedef SystemInformation *SystemInformationPtr;
/* KernelQueue Related Declarations */
typedef OptionBits KernelQueueOptions;
/* Event Flag Related Declarations */
typedef UInt32 EventGroupMask;
enum {
kEventFlagsPerGroup = 32
};
typedef UInt32 EventFlagOperation;
enum {
kEventFlagAll = 0,
kEventFlagAny = 1,
kEventFlagAllClear = 2,
kEventFlagAnyClear = 3,
kEventFlagSharedClear = 4
};
struct KernelNotification {
EventGroupID eventGroup;
EventGroupMask eventMask;
SoftwareInterruptID swi;
KernelQueueID kernelQueue;
void * queueP1;
void * queueP2;
};
typedef struct KernelNotification KernelNotification;
typedef KernelNotification *KernelNotificationPtr;
/* Task Related Declarations */
typedef OSType KernelProcessName;
typedef OSType TaskName;
typedef OSStatus (*TaskProc)(void *parameter);
typedef UInt32 TaskStorageIndex;
typedef void *TaskStorageValue;
typedef UInt32 TaskRelationship;
enum {
kTaskOnly = 0,
kTaskAndChildren = 1,
kTaskFamily = 2,
kTaskKernelProcess = 3
};
typedef OptionBits SetTaskPriorityOptions;
enum {
kTaskRaisePriorityBy = 0x00000200,
kTaskLowerPriorityBy = 0x00000400,
kTaskRaisePriorityToAtLeast = 0x00000800,
kTaskLowerPriorityToAtMost = 0x00001000
};
typedef OptionBits TaskOptions;
enum {
kTaskIsOrphan = 0x00400000,
kTaskIsResident = 0x00004000
};
/* Priorities are used by CreateTask, SetTaskPriority, and AcceptMessage. */
typedef OptionBits TaskPriority;
enum {
kTaskPriorityMask = 0x0000001F,
kTaskPriorityIsAbsolute = 0x00000100,
kTaskPriorityIsSymbolic = 0x00002000,
kTaskBackgroundPriority = 0x00002001, /* Gets only otherwise idle time*/
kTaskAppCPUBoundPriority = 0x00002002, /* For CPU bound tasks*/
kTaskAppNonUIPriority = 0x00002003, /* For general secondary tasks*/
kTaskAppPriority = 0x00002004, /* Primary tasks*/
kTaskUIHelperPriority = 0x00002005, /* Toolbox helper tasks*/
kTaskLowServerPriority = 0x00002006, /* System servers*/
kTaskServerPriority = 0x00002007, /* System serverss*/
kTaskHighServerPriority = 0x00002008, /* System servers*/
kTaskLowDriverPriority = 0x00002009, /* IO Families & plug-ins*/
kTaskDriverPriority = 0x0000200A, /* IO Families & plug-ins*/
kTaskHighDriverPriority = 0x0000200B, /* IO Families & plug-ins*/
kTaskRealTimePriority1 = 0x0000200C, /* Lowest real time priority*/
kTaskRealTimePriority2 = 0x0000200D,
kTaskRealTimePriority3 = 0x0000200E,
kTaskRealTimePriority4 = 0x0000200F,
kTaskRealTimePriority5 = 0x00002010,
kTaskRealTimePriority6 = 0x00002011,
kTaskRealTimePriority7 = 0x00002012,
kTaskRealTimePriority8 = 0x00002013,
kTaskRealTimePriority9 = 0x00002014,
kTaskRealTimePriority10 = 0x00002015,
kTaskRealTimePriority11 = 0x00002016,
kTaskRealTimePriority12 = 0x00002017,
kTaskRealTimePriority13 = 0x00002018,
kTaskRealTimePriority14 = 0x00002019,
kTaskRealTimePriority15 = 0x0000201A,
kTaskRealTimePriority16 = 0x0000201B /* Highest real time priority*/
};
typedef OptionBits TerminateOptions;
typedef OSType SchedulerState;
enum {
kTaskInformationVersion = 1
};
struct TaskInformation {
TaskName name;
KernelProcessID owningKernelProcess;
TaskOptions options; /* Includes originally specified symbolic priority*/
TaskPriority priority; /* Absolute priority*/
SchedulerState taskState;
SchedulerState swiState;
Boolean isTerminating;
Boolean reserved2[3];
ItemCount softwareInterrupts;
LogicalAddress stackLimit;
ByteCount stackSize;
AbsoluteTime creationTime;
AbsoluteTime cpuTime;
void * reserved;
};
typedef struct TaskInformation TaskInformation;
typedef TaskInformation *TaskInformationPtr;
typedef OptionBits KernelProcessOptions;
enum {
kKernelProcessIsPrivileged = 0x00000001
};
enum {
kKernelProcessInformationVersion = 1
};
struct KernelProcessInformation {
KernelProcessName name;
AddressSpaceID addressSpace;
KernelProcessOptions options;
};
typedef struct KernelProcessInformation KernelProcessInformation;
typedef KernelProcessInformation *KernelProcessInformationPtr;
/* Timer related declarations */
typedef OptionBits TimerOptions;
/* Address Space Management related declarations */
/* General definitions*/
#define kNoBackingObjectID ((BackingObjectID) kInvalidID)
typedef OptionBits AreaOptions;
enum {
kZeroFill = 0x00000001,
kResidentArea = 0x00000002,
kSparseArea = 0x00000004,
kPlacedArea = 0x00000008,
kGlobalArea = 0x00000010,
kPhysicallyContiguousArea = 0x00000020,
kMassMappedArea = 0x00000040
};
typedef OptionBits InterspaceCopyOptions;
enum {
kCheckSourceUserRights = 0x00000001,
kCheckDestinationUserRights = 0x00000002
};
typedef UInt32 AreaUsage;
enum {
kUsageUnknown = 0,
kUsageRAM = 1,
kUsageROM = 2,
kUsageIO = 3,
kUsageVideoRAM = 4
};
typedef UInt32 MemoryAccessLevel;
enum {
kMemoryExcluded = 0,
kMemoryReadOnly = 1,
kMemoryReadWrite = 2,
kMemoryCopyOnWrite = 3,
kInheritUserAccess = 4,
kInheritPrivilegedAccess = 5
};
typedef UInt64 BackingAddress;
typedef UInt64 BackingLength;
/* For GetSpaceInformation*/
enum {
kSpaceInformationVersion = 1
};
struct SpaceInformation {
ItemCount numLogicalPages;
ItemCount numInMemoryPages;
ItemCount numResidentPages;
};
typedef struct SpaceInformation SpaceInformation;
typedef SpaceInformation *SpaceInformationPtr;
/* For GetAreaInformation*/
enum {
kAreaInformationVersion = 1
};
struct AreaInformation {
AddressSpaceID addressSpace;
LogicalAddress base;
ByteCount length;
MemoryAccessLevel userAccessLevel;
MemoryAccessLevel privilegedAccessLevel;
AreaUsage usage;
BackingObjectID backingObject;
BackingAddress backingBase;
AreaOptions options;
KernelProcessID owningKernelProcess;
};
typedef struct AreaInformation AreaInformation;
typedef AreaInformation *AreaInformationPtr;
/* For Memory Reservations*/
typedef OptionBits ReservationOptions;
enum {
kPlacedReservation = 0x00000001,
kGlobalReservation = 0x00000002,
kGlobalAreaReservation = 0x00000004
};
/* For GetReservationInformation*/
enum {
kReservationInformationVersion = 1
};
struct ReservationInformation {
AddressSpaceID addressSpace;
LogicalAddress base;
ByteCount length;
ReservationOptions options;
};
typedef struct ReservationInformation ReservationInformation;
typedef ReservationInformation *ReservationInformationPtr;
/* For ControlPagingForRange*/
typedef UInt32 PageControlOperation;
enum {
kControlPageMakePageable = 1,
kControlPageMakeResident = 2,
kControlPageCommit = 3,
kControlPageTouch = 4,
kControlPageReplace = 5,
kControlPageFlush = 6,
kControlPageFlushAsync = 7
};
/* For ReleaseData*/
typedef OptionBits ReleaseDataOptions;
enum {
kReleaseBackingStore = 0x00000001
};
/* Message related declarations */
typedef UInt32 MessageType;
/* Kernel Message Types*/
#define kAllNonKernelMessageTypes (SInt32)0x0FFFFFFF
#define kAllMessages (SInt32)0xFFFFFFFF
/* Options for CreatePort*/
typedef OptionBits PortOptions;
/* Options for CreateObject*/
typedef OptionBits ObjectOptions;
/* Options for LockObject*/
typedef OptionBits ObjectLockOptions;
enum {
kLockObjectWithOneMessage = 0x00000001
};
/* Options for SetObjectInformation;*/
typedef OptionBits SetObjectOptions;
enum {
kSetObjectPort = 0x00000002,
kSetObjectRefcon = 0x00000004
};
/* Message System Options */
typedef OptionBits SendOptions;
enum {
kSendTransferKindMask = 0x00000003, /* Set by sender*/
kSendByChoice = 0x00000000,
kSendByReference = 0x00000001,
kSendByValue = 0x00000002,
kSendIsBuffered = 0x00000003,
kSendIsPrivileged = 0x00000008, /* Set by kernel*/
kSendIsAtomic = 0x00000010, /* Set by sender*/
kSendPtrsAddressable = 0x00000020, /* Set by kernel*/
kSendPtrsNeedAccessCheck = 0x00000040 /* Set by kernel*/
};
typedef OptionBits ReceiveOptions;
enum {
kReceiveNoAddressTranslation = 0x00000002
};
typedef OptionBits AcceptOptions;
enum {
kAcceptFunctionIsResident = 0x00010000
};
/* Message Definition (Given to receiver or acceptor) */
struct MessageControlBlock {
MessageID message;
AddressSpaceID addressSpace;
KernelProcessID sendingKernelProcess;
TaskID sendingTask;
void * refcon;
SendOptions options;
MessageType theType;
LogicalAddress messageContents;
ByteCount messageContentsSize;
LogicalAddress replyBuffer;
ByteCount replyBufferSize;
OSStatus currentStatus;
UInt32 reserved[4];
};
typedef struct MessageControlBlock MessageControlBlock;
typedef MessageControlBlock *MessageControlBlockPtr;
enum {
kMessageInformationVersion = 1
};
struct MessageInformation {
ObjectID object;
TaskID sendingTask;
KernelProcessID sendingKernelProcess;
};
typedef struct MessageInformation MessageInformation;
typedef MessageInformation *MessageInformationPtr;
/* Message Accept proc used to receive a message */
typedef OSStatus (*MessageAcceptProc)(const MessageControlBlock *message, void *acceptRefcon);
/* Version for GetPortInformation */
enum {
kPortInformationVersion = 1
};
/* Buffer used to return message port information */
struct PortInformation {
KernelProcessID owningKernelProcess;
MessageAcceptProc acceptProc;
ExceptionHandler acceptHandler;
AcceptOptions theAcceptOptions;
void * acceptRefcon;
ItemCount objectCount;
ItemCount pendingReceives;
ItemCount pendingSends;
ItemCount pendingReplies;
ItemCount transactionCount;
ItemCount blockedAsyncSenders;
ItemCount blockedAsyncReceivers;
};
typedef struct PortInformation PortInformation;
typedef PortInformation *PortInformationPtr;
#endif
#if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
/* Tasks */
extern ExecutionLevel CurrentExecutionLevel(void );
extern TaskID CurrentTaskID(void );
extern OSStatus DelayFor(Duration delayDuration);
extern Boolean InPrivilegedMode(void );
/* Software Interrupts */
extern OSStatus CreateSoftwareInterrupt(SoftwareInterruptHandler handler, TaskID task, void *p1, Boolean persistent, SoftwareInterruptID *theSoftwareInterrupt);
extern OSStatus SendSoftwareInterrupt(SoftwareInterruptID theSoftwareInterrupt, void *p2);
extern OSStatus DeleteSoftwareInterrupt(SoftwareInterruptID theSoftwareInterrupt);
extern void DisableSoftwareInterrupts(void );
extern void EnableSoftwareInterrupts(void );
extern Boolean InSoftwareInterruptHandler(void );
/* Completion Routines */
extern void DisableCompletionRoutines(void );
extern void EnableCompletionRoutines(void );
/* Secondary Interrupts */
extern OSStatus CallSecondaryInterruptHandler2(SecondaryInterruptHandler2 theHandler, ExceptionHandler exceptionHandler, void *p1, void *p2);
extern OSStatus QueueSecondaryInterruptHandler(SecondaryInterruptHandler2 theHandler, ExceptionHandler exceptionHandler, void *p1, void *p2);
/* Timers */
extern OSStatus SetInterruptTimer(const AbsoluteTime *expirationTime, SecondaryInterruptHandler2 handler, void *p1, TimerID *theTimer);
extern OSStatus CancelTimer(TimerID theTimer, AbsoluteTime *timeRemaining);
/* IO related Operations */
extern OSStatus PrepareMemoryForIO(IOPreparationTable *theIOPreparationTable);
extern OSStatus CheckpointIO(IOPreparationID theIOPreparation, IOCheckpointOptions options);
/* Memory Operations */
extern OSStatus GetPageInformation(AddressSpaceID addressSpace, ConstLogicalAddress base, ItemCount requestedPages, PBVersion version, PageInformation *thePageInfo);
/* Processor Cache Related */
extern OSStatus SetProcessorCacheMode(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length, ProcessorCacheMode cacheMode);
#endif
#if FOR_SYSTEM8_PREEMPTIVE
/* Queues */
extern OSStatus CreateKernelQueue(KernelQueueOptions options, KernelQueueID *theQueue);
extern OSStatus DeleteKernelQueue(KernelQueueID theQueue);
extern OSStatus WaitOnKernelQueue(KernelQueueID theQueue, void **p1, void **p2, void **p3, Duration timeOut);
extern OSStatus NotifyKernelQueue(KernelQueueID theQueue, void *p1, void *p2, void *p3);
extern OSStatus AdjustKernelQueueSIHLimit(KernelQueueID theQueue, SInt32 amount, ItemCount *newLimit);
/* Event Flag Related Operations */
extern OSStatus CreateEventGroup(EventGroupID *theGroup);
extern OSStatus DeleteEventGroup(EventGroupID theGroup);
extern OSStatus SetEvents(EventGroupID theGroup, EventGroupMask mask);
extern OSStatus ClearEvents(EventGroupID theGroup, EventGroupMask mask);
extern OSStatus ReadEvents(EventGroupID theGroup, EventGroupMask *currentValue);
extern OSStatus WaitForEvents(EventGroupID theGroup, Duration timeOut, EventGroupMask mask, EventFlagOperation operation, EventGroupMask *value);
/* KernelProcess Related Operations */
extern OSStatus CreateKernelProcess(KernelProcessName name, AddressSpaceID addressSpace, KernelProcessOptions options, KernelProcessID *theKernelProcess);
extern OSStatus ExitKernelProcess(TerminateOptions options, OSStatus exitStatus);
extern OSStatus DeleteKernelProcess(KernelProcessID theKernelProcess, TerminateOptions options, OSStatus deleteStatus);
extern OSStatus GetKernelProcessesInSystem(ItemCount requestedKernelProcesses, ItemCount *totalKernelProcesses, KernelProcessID *theKernelProcesses);
extern OSStatus GetKernelProcessInformation(KernelProcessID theKernelProcess, PBVersion version, KernelProcessInformation *kernelProcessInfo);
extern KernelProcessID CurrentKernelProcessID(void );
/* Task Related Operations */
extern OSStatus CreateTask(TaskName name, KernelProcessID owningKernelProcess, TaskProc entryPoint, void *parameter, LogicalAddress stackBase, ByteCount stackSize, const KernelNotification *notification, TaskOptions options, TaskID *theTask);
extern OSStatus ExitTask(TerminateOptions options, OSStatus exitStatus);
extern OSStatus TerminateTask(TaskID theTask, TaskRelationship scope, TerminateOptions options, OSStatus terminateStatus);
extern ByteCount RemainingStackSpace(void );
extern OSStatus GetTaskInformation(TaskID theTask, PBVersion version, TaskInformation *taskInfo);
extern OSStatus SetTaskPriority(TaskID theTask, TaskRelationship scope, SetTaskPriorityOptions options);
extern OSStatus GetTasksInKernelProcess(KernelProcessID kernelProcess, ItemCount requestedTasks, ItemCount *totalTasks, TaskID *theTasks);
extern OSStatus AllocateTaskStorageIndex(TaskStorageIndex *theIndex);
extern OSStatus DeallocateTaskStorageIndex(TaskStorageIndex theIndex);
extern OSStatus SetTaskStorageValue(TaskStorageIndex theIndex, TaskStorageValue newValue);
extern TaskStorageValue GetTaskStorageValue(TaskStorageIndex theIndex);
/* Secondary Interrupt Handlers */
extern OSStatus AdjustSecondaryInterruptHandlerLimit(SInt32 amount, ItemCount *newLimit);
/* Timers */
extern OSStatus DelayUntil(const AbsoluteTime *expirationTime);
extern OSStatus SetTimer(const AbsoluteTime *expirationTime, const KernelNotification *notification, TimerOptions options, TimerID *theTimer);
extern OSStatus ResetTimer(TimerID theTimer, const AbsoluteTime *expirationTime, const KernelNotification *notification, TimerOptions options);
extern OSStatus AdjustInterruptTimerSIHLimit(SInt32 amount, ItemCount *newLimit);
/* Address Space Management */
extern OSStatus CreateAddressSpace(AddressSpaceID *theAddressSpace);
extern OSStatus DeleteAddressSpace(AddressSpaceID theAddressSpace);
extern OSStatus GetAddressSpacesInSystem(ItemCount requestedAddressSpaces, ItemCount *totalAddressSpaces, AddressSpaceID *theAddressSpaces);
extern OSStatus GetSpaceInformation(AddressSpaceID theAddressSpace, PBVersion version, SpaceInformation *spaceInfo);
extern OSStatus InterspaceBlockCopy(AddressSpaceID sourceAddressSpace, AddressSpaceID targetAddressSpace, ConstLogicalAddress sourceBase, LogicalAddress targetBase, ByteCount length, InterspaceCopyOptions options);
extern OSStatus CheckUserAccess(ConstLogicalAddress address, ByteCount length, MemoryReferenceKind referenceKind);
extern AddressSpaceID CurrentAddressSpaceID(void );
/* Area Management */
extern OSStatus CreateArea(KernelProcessID owningKernelProcess, BackingObjectID backingObject, const BackingAddress *backingBase, ByteCount backingLength, MemoryAccessLevel userAccessLevel, MemoryAccessLevel privilegedAccessLevel, ByteCount guardLength, AreaOptions options, LogicalAddress *areaBase, AreaID *theArea);
extern OSStatus CreateAreaForRange(KernelProcessID owningKernelProcess, AddressSpaceID otherSpace, ConstLogicalAddress otherBase, ByteCount length, MemoryAccessLevel userAccessLevel, MemoryAccessLevel privilegedAccessLevel, ByteCount guardLength, AreaOptions options, LogicalAddress *areaBase, AreaID *theArea);
extern OSStatus DeleteArea(AreaID theArea);
extern OSStatus GetAreaInformation(AreaID theArea, PBVersion version, AreaInformation *areaInfo);
extern OSStatus GetAreaFromAddress(AddressSpaceID addressSpace, ConstLogicalAddress address, AreaID *theArea);
extern OSStatus GetAreasInAddressSpace(AddressSpaceID addressSpace, ItemCount requestedAreas, ItemCount *totalAreas, AreaID *theAreas);
extern OSStatus SetAreaAccess(AreaID theArea, MemoryAccessLevel userAccessLevel, MemoryAccessLevel privilegedAccessLevel);
extern OSStatus SetAreaBackingBase(AreaID theArea, const BackingAddress *backingBase);
extern OSStatus CreateAreaReservation(KernelProcessID owningKernelProcess, LogicalAddress *reservationBase, ByteCount length, ReservationOptions options, AreaReservationID *theReservation);
extern OSStatus DeleteAreaReservation(AreaReservationID theReservation);
extern OSStatus GetReservationInformation(AreaReservationID theReservation, PBVersion version, ReservationInformation *reservationInfo);
extern OSStatus GetReservationsInAddressSpace(AddressSpaceID addressSpace, ItemCount requestedReservations, ItemCount *totalReservations, AreaReservationID *theReservations);
/* Processor Cache Related */
extern OSStatus DataToCode(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length);
extern OSStatus FlushRange(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length);
/* Paging control operations */
extern OSStatus ControlPagingForRange(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length, PageControlOperation operation);
extern OSStatus ReleaseData(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length, ReleaseDataOptions options);
/* Message Port Management */
extern OSStatus CreatePort(PortOptions options, PortID *thePort);
extern OSStatus DeletePort(PortID thePort);
extern OSStatus GetPortInformation(PortID thePort, PBVersion version, PortInformation *portInfo);
extern OSStatus GetPortsInSystem(ItemCount requestedPorts, ItemCount *totalPorts, PortID *thePorts);
/* Message Object Management */
extern OSStatus CreateObject(PortID port, void *refcon, ObjectOptions options, ObjectID *theObject);
extern OSStatus DeleteObject(ObjectID theObject);
extern OSStatus LockObject(ObjectID theObject, ObjectLockOptions options, Duration timeOut);
extern OSStatus UnlockObject(ObjectID theObject);
extern OSStatus GetObjectInformation(ObjectID theObject, PortID *port, void **refcon);
extern OSStatus SetObjectInformation(ObjectID theObject, SetObjectOptions options, PortID port, void *refcon);
extern OSStatus GetObjectsInPort(PortID port, ItemCount requestedObjects, ItemCount *totalObjects, ObjectID *theObjects);
/* Message Transaction Operations */
extern OSStatus SendMessageSync(ObjectID object, MessageType theType, ConstLogicalAddress messageContents, ByteCount messageContentsSize, LogicalAddress replyBuffer, ByteCount *replyBufferSize, SendOptions options, Duration timeOut);
extern OSStatus SendMessageAsync(ObjectID object, MessageType theType, ConstLogicalAddress messageContents, ByteCount messageContentsSize, LogicalAddress replyBuffer, ByteCount replyBufferSize, SendOptions options, const KernelNotification *notification, ByteCount *replySize, MessageID *theMessage);
extern OSStatus AcceptMessage(PortID port, MessageType theTypes, MessageAcceptProc acceptProc, ExceptionHandler theExceptionHandler, AcceptOptions options, void *acceptRefcon);
extern OSStatus ReceiveMessageSync(PortID port, MessageType theTypes, MessageControlBlock *theControlBlock, LogicalAddress buffer, ByteCount bufferSize, ReceiveOptions options, Duration timeOut);
extern OSStatus ReceiveMessageAsync(PortID port, MessageType theTypes, MessageControlBlock *theControlBlock, LogicalAddress buffer, ByteCount bufferSize, ReceiveOptions options, const KernelNotification *notification, ReceiveID *theReceive);
extern OSStatus ReplyToMessage(MessageID theMessage, OSStatus status, ConstLogicalAddress replyBuffer, ByteCount replyBufferSize);
extern OSStatus ReplyToMessageAndReceive(MessageID theMessage, OSStatus status, ConstLogicalAddress replyBuffer, ByteCount replyBufferSize, PortID port, MessageType theTypes, MessageControlBlock *theControlBlock, LogicalAddress receiveBuffer, ByteCount receiveBufferSize, ReceiveOptions options, Duration timeOut);
/* Miscellaneous Messaging operations */
extern OSStatus CancelAsyncSend(MessageID theMessage);
extern OSStatus CancelAsyncReceive(ReceiveID theReceive);
extern OSStatus GetMessageInformation(MessageID theMessage, PBVersion version, MessageInformation *messageInfo);
/* Miscellaneous System operations */
extern OSStatus GetSystemInformation(PBVersion version, SystemInformation *systemInfo);
/* Notifications */
extern OSStatus DeliverKernelNotification(const KernelNotification *notification, OSStatus status);
#endif
#if FOR_SYSTEM8_PREEMPTIVE
/* These are defined in Memory for System 7 */
extern pascal void BlockMove(const void *srcPtr, void *destPtr, long byteCount);
extern pascal void BlockMoveData(const void *srcPtr, void *destPtr, long byteCount);
extern void BlockMoveUncached(const void *srcPtr, void *destPtr, long byteCount);
extern void BlockMoveDataUncached(const void *srcPtr, void *destPtr, long byteCount);
extern void BlockZero(void *destPtr, long byteCount);
extern void BlockZeroUncached(void *destPtr, long byteCount);
#endif
#pragma options align=reset
#endif /* PRAGMA_ALIGN_SUPPORTED */
#if PRAGMA_IMPORT_SUPPORTED
#pragma import off
#endif
#ifdef __cplusplus
}
#endif
#endif /* __KERNEL__ */